<%@page import="model.CategoryImp"%>
<%@page import="model.BillImp"%>
<%@page import="model.entity.*"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.io.*,java.util.*, javax.servlet.*" %>


<div class="tab_container">
    <div id="tab2" class="tab_content" style="display: block;">
        <h2>Bill detail</h2>


        <p class="message1">
<%
                            String message1 = request.getAttribute("messageedit")==null ? "":request.getAttribute("messageedit").toString();
                        out.println(message1);
%>
                 </p>
        <%
        Bill b = (Bill) request.getAttribute("bill");
        %>  
        <form action="<c:url value="<%= "/admin/bill/detail/" + b.getBillid() %>" />" method="POST"  >


            <p>
                <label>Username:</label><br/>
                <input class="text small" type="text" readonly="true" name="username" value="<%= b.getUsername() %>"/>
            </p>
           
            <p>
                <label>Date</label><br/>
                <input class="text small" type="text" readonly="true" name="datepurchase" value="<%= b.getDatepurchase() %>"/>
            </p>
          
    <label for="cbo">Payment :</label>
   
    <select name="status" id="cbo" class="select">

        <option <%= b.isStatus() == true ? "selected='selected'" : "" %> value="True">Payment</option>
        <option <%= b.isStatus() == false ? "selected='selected'" : "" %> value="False">Not</option>
           
    </select>
        <p>
            <label>Bill Detail</label>
        <table width="960px" class="" border="0" cellpadding="0" cellspacing="0">
    <thead>
        <tr>
            <th width="40%%" scope="col">Product Id</th>
            <th width="40%" scope="col">Amount</th>
            <th width="20%" scope="col">Quantity</th>
        </tr>
    </thead>
        <tbody id="movies">
            
<%
    BillImp bim = new BillImp();            
    List<BillDetail> listb = bim.ListBillDetail(b.getBillid());
    for(BillDetail list1 : listb)
    {
%>
        <tr>
            <td><%= list1.getProductid() %></td>
            <td><%= list1.getAmount() %></td>
            <td><%= list1.getQuantity() %></td>

        </tr>
<%
    }
%>      
    </tbody></table>
         <p>
                <label>Total amount</label><br/>
                <input class="text small" type="text" readonly="true" name="totalamount" value="<%= b.getTotalamount() %>"/>
            </p>
        </p>

            <p>
                <input type="submit" class="submit" value="Edit" >
            </p>

        </form>

    </div>
</div>